import React, { useEffect, useState } from 'react';
import { Button, Input, Form } from 'react-vant';
import axios from 'axios';

export default () => {
    const [form] = Form.useForm();
    const [data, setDate] = useState([])
    const onFinish = values => {
        console.log(values)
    }
   

    return (
        <Form
            form={form}
            onFinish={onFinish}
            footer={
                <div style={{ margin: '16px 16px 0' }}>
                    <Button round nativeType='submit' type='primary' block>
                        添加
                    </Button>
                </div>
            }
        >
            <Form.Item
                tooltip={{
                    message: '请输入要添加对话的用户名称和用户邮箱，确保不会重复',
                }}
                intro='确保这是唯一的用户名'
                rules={[{ required: true, message: '请填写用户名' }]}
                name='username'
                label='用户名'
            >
                <Input placeholder='请输入用户名' />
            </Form.Item>
            <Form.Item
                rules={[{ required: true, message: '请填写用户邮箱' }]}
                name='email' // Updated name to 'email'  
                label='邮箱'
            >
                <Input placeholder='请输入用户邮箱' />
            </Form.Item>
        </Form>
    );
}